import * as React from 'react';
import SideMenu from "@/react/routes/test/side-menu";
import {MenuItem} from "@/react/routes//test/side-menu/SideMenu";
import Input from "@/react/routes/test/v-input/Input";
import {Button} from "react-iaux";

export interface MenuTestProps {

}

const menuList: MenuItem[] = [
  {
    key: -1,
    title: '政策法规',
    icon: '',
    children: [
      {
        key: 10,
        title: '国家标准(8)',
        icon: '',
      },
      {
        key: 20,
        title: '行业规章(5)',
        icon: '',
        children: [
          {
            key: 100,
            title: '国家标准(8)',
            icon: '',
          },
          {
            key: 200,
            title: '行业规章(5)',
            icon: '',
          }
        ]
      }
    ]
  }
]

class MenuTest extends React.Component<MenuTestProps, any> {
  static propTypes = {};
  static defaultProps = {};
  state = {
    value: '2222',
  }
  handleTextChange = (value: string) => {
    console.log(value)
    this.setState({value});
  }

  render() {
    return (
      <div style={{padding: 40, background: '#02213a', height: '100%'}}>
        <SideMenu data={menuList} />
        <Button onClick={() => this.setState({value: 12000})}>Change</Button>
        <Input value={this.state.value} onChange={this.handleTextChange} />
      </div>
    )
  }
}

export default MenuTest;
